<?php /* Smarty version 2.6.26, created on 2018-07-05 16:53:44
         compiled from D:%5Cwww%5Cvweb/admin%5Ctemplates/api/config_email.html */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
<div class="nav">
	<a href="?m=api&a=config_email"<?php if ($_GET['a'] == 'config_email'): ?> class="ch"<?php else: ?><?php endif; ?>>邮件设置</a>
	<a href="?m=api&a=notice_tpl&type=email"<?php if ($_GET['type'] == 'email'): ?> class="ch"<?php else: ?><?php endif; ?>>邮件模板</a> 
</div>
<?php if ($this->_tpl_vars['error_status']): ?> 
	<div class="notice">
		<i><img src="<?php echo $this->_tpl_vars['__APP__']; ?>
public/images/notice.png" width="20"/></i>
		<span>您的当前不能发送邮件，发送邮件需要支持openssl，如有疑问，可以联系系统官方。</span>
	</div>
<?php endif; ?>
<div class="explain">
	<div class="name"><span>操作提示</span></div>
	<div class="con">
		<p>查看各家接口的数据，接口几乎统一为：465接口。</p>
	</div>
</div> 
<div class="main">
<form action="?m=config&a=post" method="post" back="false">
	<table class="etable">
		<tr>
			<td width="120">发件人名称：</td>
			<td><input type="text" size="36" name="email_name" value="<?php echo $this->_tpl_vars['UQCMS']['email_name']; ?>
"/></td>
	  	</tr>
		<tr>
			<td>SMTP地址：</td>
			<td>
				<input type="text" size="36" name="email_host" value="<?php echo $this->_tpl_vars['UQCMS']['email_host']; ?>
" placeholder="服务商的SMTP地址"/>
				<p>如：smtp.qq.com ,smtp.126.com, smtp.126.com</p>	
			</td>
	  	</tr>
	 	<tr>
			<td>SMTP端口：</td>
			<td>
				<input type="text" size="36" name="email_port" value="<?php echo $this->_tpl_vars['UQCMS']['email_port']; ?>
" placeholder="端口号：一般465"/>
				<p>正常情况下统一为465端口</p>	 
			</td>
	  	</tr> 
	  	<tr>
			<td>SMTP用户名：</td>
			<td><input type="text" size="36" name="email_username" value="<?php echo $this->_tpl_vars['UQCMS']['email_username']; ?>
" placeholder="邮箱用户名"/>
				<p>邮箱的用户名</p>	 
			</td>
	  	</tr>
	 	<tr>
			<td>SMTP密码：</td>
			<td><input type="password" size="36" name="email_password" value="<?php echo $this->_tpl_vars['UQCMS']['email_password']; ?>
" placeholder="邮箱密码"/><p>邮箱的密码</p></td>
	  	</tr> 
		<tr>
			<td>测试收件人：</td>
			<td>
				<input type="text" size="36" id="test_email" placeholder="自己的邮箱，测试发送是否成功。"/>
				<input type="button" value="发送测试邮件" id="test_submit" class="submit2"/>
				<p>发送成功，则短信配置正常，发送失败，则无法使用邮件提醒功能。</p>
			</td>
	  	</tr>
		<tr>
			<td>状态：</td>
			<td>
				<label><input type="radio" name="email_state" value="1" <?php if ($this->_tpl_vars['UQCMS']['email_state'] == '1'): ?>checked="checked"<?php endif; ?>/> 开启 </label>
				<label><input type="radio" name="email_state" value="0" <?php if ($this->_tpl_vars['UQCMS']['email_state'] == '0' || $this->_tpl_vars['UQCMS']['email_state'] == ''): ?>checked="checked"<?php endif; ?>/> 关闭 </label>
			</td>
	  	</tr>
	  	<tr>
			<td>&nbsp;</td>
			<td><input type="submit" id="submit" value="提交"/></td>
	 	</tr>
	</table>
</form> 
</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
<script type="text/javascript">
$(function(){
	$("#test_submit").click(function(){
		$this = $(this);
		var email = $("#test_email").val();
		$.post('?m=config&a=email_test',{email:email},function(result){
			var data = jQuery.parseJSON(result); 
			if(data.error == '0'){
				parent.$.alert('发送成功');
			}else{
				parent.$.alert(data.msg);
			} 
		}); 
	}); 
});
</script>